<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<style>
.prog-border {
	height: 15px;
	width: 205px;
	background: #fff;
	border: 1px solid #000;
	margin: 0;
	padding: 0;
}

.prog-bar {
	height: 11px;
	margin: 2px;
	padding: 0px;
	background: #178399;
	font-size: 10pt;
}

body {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 10pt;
}
</style>

	<script src="prototype.js" language="JavaScript" type="text/javascript"></script>
	<script type="text/javascript" language="JavaScript">
  var updater = null;

  function startStatusCheck(){
    //设置上传按钮为不可用状态，避免多次提交
    $('submitButton').disabled = true;
    //创建周期性发送请求的Ajax对象
    updater = new Ajax.PeriodicalUpdater(
                                'status',
                                'fileupload',
                                {asynchronous:true, frequency:1, method: 'get', parameters: 'c=status', onFailure: reportError});

    return true;
  }
  
  //出错时处理方法
  function reportError(request){
    $('submitButton').disabled = false;

    $('status').innerHTML = '<div class="error"><b>Error communicating with server. Please try again.</b></div>';
  }
  
  //上传完毕后,取消周期性获取进度状态，将最终的状态显示在客户端
  function killUpdate(message){
    $('submitButton').disabled = false;
    //停止刷新获取进度
    updater.stop();
    if(message != '')//如果有错误信息，则显示出来
    {
      $('status').innerHTML = '<div class="error"><b>Error processing results: ' + message + '</b></div>';
    }
    else//如果没有错误信息
    {
      //获取上传文件的完成状态，显示到客户端
      new Ajax.Updater('status',
                     'fileupload',
                     {asynchronous:true, method: 'get', parameters: 'c=status', onFailure: reportError});
    }
  }
  </script>

<!-- add=========================== -->
<style type="text/css">
<!--
body{background:#fff}
.Menu {
position:relative;
width:204px;
height:127px;
z-index:1;
background: #FFF;
border:1px solid #000;
margin-top:-100px;
display:none;
}
.Menu2 {
position: absolute;
left:0;
top:0;
width:100%;
height:auto;
overflow:hidden;
z-index:1;
}
.Menu2 ul{margin:0;padding:0}
.Menu2 ul li{width:100%;height:25px;line-height:25px;text-indent:15px;
border-bottom:1px dashed #ccc;color:#666;cursor:pointer;
change:expression(
this.onmouseover=function(){
this.style.background="#F2F5EF";
},
this.onmouseout=function(){
this.style.background="";
}
)
}
input{width:200px}
.form{width:200px;height:auto;}
.form div{position:relative;top:0;left:0;margin-bottom:5px}
#List1,#List2,#List3{left:0px;top:93px;}
-->
</style>
<script type="text/javascript">
function showAndHide(obj,types){
var Layer=window.document.getElementById(obj);
switch(types){
case "show":
Layer.style.display="block";
break;
case "hide":
Layer.style.display="none";
break;
}
}
function getValue(obj,str){
var input=window.document.getElementById(obj);
input.value=str;
}
</script>
<!-- add end=========================== -->


	<head>
		<title>注册首页</title>
		<link href="css/style.css" rel="stylesheet" type="text/css">
	</head>
	<body>
		<center>
			<h1>
				发布视频
			</h1>
			<!-- 这个是隐藏的<ifame>作为表单提交后处理的后台目标-->
			<iframe id='target_upload' name='target_upload' src=''
				style='display: none'></iframe>
			<!-- 当表单提交后,调用startStatusCheck()方法-->

			<div>
				<form enctype="multipart/form-data" name="fileform" method="post"
					action="defalut"
					target="target_upload">



					<div> 课程名称：<br>
						<input type="text" id="id_coursename" name="coursename" onfocus="showAndHide('List1','show');" onblur="showAndHide('List1','hide');"/>
					</div>
<!--列表1-->
<div class="Menu" id="List1">
<div class="Menu2">
<ul>
<li onmousedown="getValue('id_coursename','中');showAndHide('List1','hide');">中国C</li>
<li onmousedown="getValue('id_coursename','美国USA');showAndHide('List1','hide');">SA</li>
</ul>
</div>
</div>
					<div>课程名分类:<br> 
						       <select id="s1_text1_bold">
                                    <option value="0" selected="selected">0</option>
                                    <option value="1">1</option>
                                    <option value="2">2</option>
                                    <option value="3">3</option>
                                    <option value="4">4</option>
                                    <option value="5">5</option>
                                    <option value="6">6</option>
                                </select>
					</div>
					课程简介:
					<br>

					<textarea name="coursecontent" cols="40" rows="4"></textarea><p><p><p><p>
														<p>
															<p>
																<p>

																</p>



<form enctype="multipart/form-data" name="fileform" method="post"
					action="fileupload" onsubmit="return startStatusCheck();"
					target="target_upload">

																请选择上传的文件：
																<BR>
																<input name="importFile" type="file">
				<input name="upload" id="submitButton" type="submit" value="上传" />




				<div id="status"></div>
																<br><br><!-- 这里显示进度条 -->
					</form>


					<input name="submit" type="submit" value="提交" />
					<input type="reset" value="重置" />
				</form>
				
			</div>

			<center>
	</body>
</html>
